﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Web.SessionState;

namespace wxx.wxxweb
{
    /// <summary>
    /// login1 的摘要说明
    /// </summary>
    public class login1 : IHttpHandler,IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            wxx.BLL.t_guanliyuan bll = new wxx.BLL.t_guanliyuan(context);
            wxx.Model.t_guanliyuan model = new wxx.Model.t_guanliyuan();
            if (context.Request.QueryString["type"] == "login")
            {
                String Account = context.Request.QueryString["Account"];
                String PassWord = context.Request.QueryString["PassWord"];
                DataSet ds = bll.GetList("Account='" + Account + "'and PassWord='" + PassWord+"'");
                int num = ds.Tables[0].Rows.Count;
                if (num >0)
                {
                    context.Session["user"] = Account;
                    context.Response.Write("true");
                }
                else
                {
                    context.Response.Write("false");
                }
                return;
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}